//
//  MainProcessCell.m
//  Peso Guide
//
//  Created by macbook on 2025/6/7.
//

#import "MainProcessCell.h"

@interface MainProcessCell ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIImageView *bgImg;
@property (nonatomic, strong) UIButton *theOneButtonView;
@property (nonatomic, strong) UIButton *theTwoButtonView;
@property (nonatomic, strong) UIButton *theThreeButtonView;

@end

@implementation MainProcessCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = [UIColor clearColor];

        _bgView = [PesoKit createViewWithFrame:CGRectMake(0, 0, KScreenWidth, ceil((KScreenWidth-40)*0.65373)+10) backGroundColor:[UIColor whiteColor]];
        [self.contentView addSubview:_bgView];

        _bgImg = [PesoKit createImageViewWithFrame:CGRectMake(20, 0, KScreenWidth-40, ceil((KScreenWidth-40)*0.65373)) imageNamed:@"bg_main_process_back_img"];
        _bgImg.userInteractionEnabled = YES;
        [self.contentView addSubview:_bgImg];
        
        UILabel *titLabel = [PesoKit createLabelWithFrame:CGRectMake(16, 32, _bgImg.width, 22) backGroundColor:[UIColor clearColor] text:[Lang set:@"Application process"] textColor:ColorHex(@"#105818") font:FONT(FontWeightStyleMedium, 16)];
        [_bgImg addSubview:titLabel];
        
        _theOneButtonView = [[UIButton alloc] initWithFrame:CGRectMake(16, _bgImg.height-15-42-10-42-10-42, _bgImg.width-32, 42)];
        _theOneButtonView.clipsToBounds = YES;
        _theOneButtonView.layer.cornerRadius = 10.0f;
        _theOneButtonView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF" alpha:0.4];
        [_theOneButtonView addTarget:self action:@selector(oneButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [_bgImg addSubview:_theOneButtonView];
        
        UILabel *numberOneLabel = [PesoKit createLabelWithFrame:CGRectMake(12, 0, 42, 42) backGroundColor:[UIColor clearColor] text:@"01" textColor:ColorHex(@"#287D30") font:FONT(FontWeightStyleMedium, 16)];
        numberOneLabel.textAlignment = NSTextAlignmentCenter;
        [_theOneButtonView addSubview:numberOneLabel];
        
        UILabel *numberOneTitleLabel = [PesoKit createLabelWithFrame:CGRectMake(104, 0, _theOneButtonView.width-104, 42) backGroundColor:[UIColor clearColor] text:[Lang set:@"Fill information"] textColor:ColorHex(@"#0E1D31") font:FONT(FontWeightStyleRegular, 18)];
        [_theOneButtonView addSubview:numberOneTitleLabel];
        
        UIImageView *numberOneIcon = [PesoKit createImageViewWithFrame:CGRectMake(78, 12, 16, 17) imageNamed:@"ic_main_header_one"];
        [_theOneButtonView addSubview:numberOneIcon];

        
        _theTwoButtonView = [[UIButton alloc] initWithFrame:CGRectMake(16, _theOneButtonView.bottom+10, _bgImg.width-32, 42)];
        _theTwoButtonView.clipsToBounds = YES;
        _theTwoButtonView.layer.cornerRadius = 10.0f;
        _theTwoButtonView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF" alpha:0.4];
        [_theTwoButtonView addTarget:self action:@selector(twoButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [_bgImg addSubview:_theTwoButtonView];
        
        UILabel *numberTwoLabel = [PesoKit createLabelWithFrame:CGRectMake(12, 0, 42, 42) backGroundColor:[UIColor clearColor] text:@"02" textColor:ColorHex(@"#287D30") font:FONT(FontWeightStyleMedium, 16)];
        numberTwoLabel.textAlignment = NSTextAlignmentCenter;
        [_theTwoButtonView addSubview:numberTwoLabel];
        
        UILabel *numberTwoTitleLabel = [PesoKit createLabelWithFrame:CGRectMake(104, 0, _theTwoButtonView.width-104, 42) backGroundColor:[UIColor clearColor] text:[Lang set:@"Review and approval"] textColor:ColorHex(@"#0E1D31") font:FONT(FontWeightStyleRegular, 18)];
        [_theTwoButtonView addSubview:numberTwoTitleLabel];
        
        UIImageView *numberTwoIcon = [PesoKit createImageViewWithFrame:CGRectMake(78, 12, 16, 17) imageNamed:@"ic_main_header_two"];
        [_theTwoButtonView addSubview:numberTwoIcon];
        
        
        _theThreeButtonView = [[UIButton alloc] initWithFrame:CGRectMake(16, _theTwoButtonView.bottom+10, _bgImg.width-32, 42)];
        _theThreeButtonView.clipsToBounds = YES;
        _theThreeButtonView.layer.cornerRadius = 10.0f;
        _theThreeButtonView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
        [_theThreeButtonView addTarget:self action:@selector(threeButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [_bgImg addSubview:_theThreeButtonView];
        
        UILabel *numberThreeLabel = [PesoKit createLabelWithFrame:CGRectMake(12, 0, 42, 42) backGroundColor:[UIColor clearColor] text:@"02" textColor:ColorHex(@"#287D30") font:FONT(FontWeightStyleMedium, 16)];
        numberThreeLabel.textAlignment = NSTextAlignmentCenter;
        [_theThreeButtonView addSubview:numberThreeLabel];
        
        UILabel *numberThreeTitleLabel = [PesoKit createLabelWithFrame:CGRectMake(104, 0, _theThreeButtonView.width-104, 42) backGroundColor:[UIColor clearColor] text:[Lang set:@"Review and approval"] textColor:ColorHex(@"#0E1D31") font:FONT(FontWeightStyleRegular, 18)];
        [_theThreeButtonView addSubview:numberThreeTitleLabel];
        
        UIImageView *numberThreeIcon = [PesoKit createImageViewWithFrame:CGRectMake(78, 12, 16, 17) imageNamed:@"ic_main_header_three"];
        [_theThreeButtonView addSubview:numberThreeIcon];
    }
    return self;
}

- (void)oneButtonClick {
    DLog(@"----one");
}

- (void)twoButtonClick {
    DLog(@"----two");
}

- (void)threeButtonClick {
    DLog(@"----three");
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
